import com.ruoyi.RuoYiApplication;
import com.ruoyi.util.WebSocketUtilsReq;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

/**
 * @program: ChainUp_Monitor_Rear
 * @description:
 * @author: Saumell
 * @create: 2024-08-06 15:32
 **/
@RunWith(SpringRunner.class)
@SpringBootTest(classes = RuoYiApplication.class)
public class test0806 {

    @Test
    public void test1() throws Exception {
// Define the WebSocket URL and request parameter
        String url = "wss://ws.f4mes.com/kline-api/ws";
        String reqParam = "{\"event\":\"req\",\"params\":{\"channel\":\"market_btcusdt_kline_30min\",\"cb_id\":\"1\"}}";

        // Create an instance of WebSocketUtilsReq
        WebSocketUtilsReq webSocketUtilsReq = new WebSocketUtilsReq(url, reqParam);

        // Retrieve the decompressed message
        String message = webSocketUtilsReq.getDecompressedMessage();

        // Check if the message is null or not and print it
        if (message != null) {
            System.out.println("Received message: " + message);
        } else {
            System.out.println("No message received or an error occurred.");
        }
    }

}

